package top.healthylife.gateway.platform.eye.api.api.jingyingfengxian;

import cn.hutool.core.bean.BeanUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import top.healthylife.gateway.core.service.ParentFace;
import top.healthylife.gateway.core.util.SystemConfigUtils;
import top.healthylife.gateway.dto.annotation.ApiServiceExplain;
import top.healthylife.gateway.platform.eye.api.config.SystemConfig;
import top.healthylife.gateway.platform.eye.api.util.OutHttpUtil;
import top.healthylife.gateway.platform.eye.dto.jingyingfengxian.EyeReqBriefCancelDto.req.EyeReqBriefCancelDto;
import top.healthylife.gateway.platform.eye.dto.jingyingfengxian.EyeReqBriefCancelDto.res.Eyeresbriefcanceldto;

/**
* @author: GenUtil
* @date: 2020-12-15 19:07:25
*/
@Slf4j
@Service
@ApiServiceExplain(price = 15,docUrl ="http://open.tianyancha.com/open/960",apiName = "简易注销[960]", info = "可以通过公司名称或ID获取企业简易注销公告信息，企业简易注销公告信息包括全体投资人承诺书、异议信息、简易注销结果等字段的详细信息")
public class EyeBriefCancelApi implements ParentFace<EyeReqBriefCancelDto, Eyeresbriefcanceldto> {

    static final String URL = "http://open.api.tianyancha.com/services/open/mr/briefCancel/2.0";

    /**
     * 执行这个服务接口
     * 如果成功，返回成功结果，如果接口错误，直接抛异常即可
     *
     * @param eyeDto 请求参数
     * @return 查询的真实结果，如果是失败，则直接返回异常即可
     */
    @Override
    public Eyeresbriefcanceldto execute(EyeReqBriefCancelDto eyeDto) {
        //可直接通过工具类获取这个对象
        SystemConfig o = (SystemConfig) SystemConfigUtils.get();
        return OutHttpUtil.get(URL, BeanUtil.beanToMap(eyeDto), o, Eyeresbriefcanceldto.class);
    }
}
